<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .container{
            display: flex;
            width: 600px;
        }
        .item{
            display: flex;
            justify-content: center;
            align-items: center;
            margin:0 25px;
            padding: 0 10px;
            line-height: 45px;
        }
        .active{
            color: tomato;
            border-bottom: 2px solid tomato;
        }
    </style>
</head>
<body>
    <div id="root">
        <div class="container">
            <div :class="{item:true,active:activeIndex==index}" v-for="(item,index) in list" @click="activeIndex=index">{{item}}</div>
        </div>
    </div>
    <script>
        new Vue({
            el:'#root',
            data(){
                return{
                    activeIndex:0,
                    list:['全部','免费试用','折扣试用','专享试用']
                }
            }
        })
    </script>
</body>
</html>